import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;


public class popupNotice extends Thread
{
	JPopupMenu popup;
	private int time = 500;
	public popupNotice(int X, int Y, String msg)
	{
		popup = new JPopupMenu();
		popup.add(new JMenuItem(msg));
		popup.setLocation(X, Y);
	}
	public popupNotice(int X, int Y, String msg,int ms)
	{
		popup = new JPopupMenu();
		popup.add(new JMenuItem(msg));
		popup.setLocation(X, Y);
		time = ms;
	}
	public void setTime (int ms)
	{
		time = ms;
	}
	public void run()
	{
		//thread stuff
	
		//show for like a second and then hide
		//show:
		//popup.setVisible(true);
		
		//sleep:
		try
		{
			sleep(time);
		}
		catch (InterruptedException e)
		{
			e.printStackTrace();
		}
		
		//hide
		popup.setVisible(false);
		
	}
}
